<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>{{$books->book_name}} - 发表短书评 - 夜读书</title>
    <meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="format-detection" content="telephone=no">
    <meta name="author" content="夜读书">
    <meta name="description" content="{{mb_substr(strip_tags($books->neirongjianjie),0,160)}}">
    <meta name="keywords" content="{{$books->book_name}},{{$books->book_name}}的书评,{{$books->book_name}}简介,{{$books->book_name}}的作者,夜读书">
    <link rel="stylesheet" href="{{ asset('/bootstrap-3.3.5-dist/css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ asset('/style/css/mobile.css') }}">    
    <script src="{{ asset('/scripts/jquery/jquery-1.11.3.min.js') }}"></script>
    <script src="{{ asset('/bootstrap-3.3.5-dist/js/bootstrap.min.js') }}"></script>
    {{-- umeditor --}}
    <script type="text/javascript" charset="utf-8" src="{{ asset('/editor/bkcomm_ueditor1_4_3_1/ueditor.config.js') }}"></script>
    <script type="text/javascript" charset="utf-8" src="{{ asset('/editor/bkcomm_ueditor1_4_3_1/ueditor.all.js') }}"> </script>
    <script type="text/javascript" charset="utf-8" src="{{ asset('/editor/bkcomm_ueditor1_4_3_1/lang/zh-cn/zh-cn.js') }}"></script>
    {{-- umeditor end --}}
</head>
<body>
<div class="navbk">
	<div class="page" style="padding:0 5px;">
		<a href="{{url('mobile/info/'. $books->book_id)}}"><img style="width: 30px;height: 40px;" src="{{url($books->bimg)}}"><span style="padding-left: 10px;color:#42bd56;">{{$books->book_name}}</span></a>
	</div>
</div>
<div id="commentlist" class="page" style="padding: 0 5px;">
	<form id="form" name="form" action="" method="post">
		<input type="hidden" name="_token" value="{{ csrf_token() }}" />
		<div class="" style="text-align:center;line-height: 50px;">
			<a href="javascript:commentsubmit()"><span style="float:right;">发表</span></a>
			<a href="javascript:;" onClick="javascript:history.back(-1);"><span style="float:left;">取消</span></a>
			<span style="">发表评论</span>		
		</div>
		<div class="form-group">
		    <script id="editor" name="message" type="text/plain" style="width:100%;height:100px;"></script>
		    <script type="text/javascript">
		    //实例化编辑器                    
		    var ue = UE.getEditor('editor');
		    </script>
		</div>
	</form>
</div>
@include('mobile.footer')
<script type="text/javascript">
	function commentsubmit()
	{
		if(!UE.getEditor('editor').hasContents())
		{
			//评论内容不能为空
			alert('请写评论内容');
			UE.getEditor('editor').focus();
		}
		else if((UE.getEditor('editor').getContentTxt()).length<5)
        {            
            alert('书评内容不能少于5个文字');
            UE.getEditor('editor').focus();
        }
        else if((UE.getEditor('editor').getContentTxt()).length>350)
        {
            alert('多余350字的评论请去发表长书评');
            UE.getEditor('editor').focus();
        }
        else
        {
            form.submit();
        }
	}
</script>
</body>
</html>
